﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas1a28
    {
        private int? _levercode;
		private string _levername;
		private double _arrgamt;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 等级代码
        /// </summary>
		public int? Levercode
		{
			get { return _levercode;	 }
			set { _levercode=value;	}
		}
        /// <summary>
        /// 等级名称
        /// </summary>
		public string Levername
		{
			get { return _levername;	 }
			set { _levername=value;	}
		}
        /// <summary>
        /// 最高欠款额
        /// </summary>
		public double Arrgamt
		{
			get { return _arrgamt;	 }
			set { _arrgamt=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Bas1a28> GetBas1a28ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas1a28> list = new List<Bas1a28>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas1a28 model = GetBas1a28ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas1a28 GetBas1a28ByDataRow(DataRow dr)
		{
			Bas1a28 model = new Bas1a28(); //实例化Bas1a28
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("levercode")&&!(dr["levercode"] is System.DBNull))  
				model.Levercode = ( int)dr["levercode"];
			if (dcc.Contains("levername")&&!(dr["levername"] is System.DBNull))  
				model.Levername = ( string)dr["levername"];
			if (dcc.Contains("arrgamt")&&!(dr["arrgamt"] is System.DBNull))  
				model.Arrgamt = Convert.ToDouble(dr["arrgamt"]);
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
